package com.mbc.web.common.client.controller;

import java.util.Date;
import java.util.List;

import com.google.gwt.user.client.rpc.RemoteService;
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
import com.mbc.common.data.CurrencyReferenceData;
import com.mbc.common.data.UserData;
import com.mbc.common.entities.Branch;
import com.mbc.common.entities.BranchRpt;
import com.mbc.common.entities.BranchType;
import com.mbc.common.entities.BranchTypeRpt;
import com.mbc.common.entities.Country;
import com.mbc.common.entities.CountryRpt;
import com.mbc.common.entities.Currency;
import com.mbc.common.entities.CurrencyRate;
import com.mbc.common.entities.CurrencyRateDetail;
import com.mbc.common.entities.CurrencyRateRpt;
import com.mbc.common.entities.CurrencyRpt;
import com.mbc.common.entities.SystemProperty;
import com.mbc.web.common.shared.dto.AppItemListDTO;
import com.mbc.web.common.shared.dto.BranchDataListDTO;
import com.mbc.web.common.shared.dto.BranchListDTO;
import com.mbc.web.common.shared.dto.BranchTypeDataListDTO;
import com.mbc.web.common.shared.dto.BranchViewLoadDTO;
import com.mbc.web.common.shared.dto.CountryDataListDTO;
import com.mbc.web.common.shared.dto.CurrencyDataListDTO;
import com.mbc.web.common.shared.dto.CurrencyRateDataListDTO;
import com.mbc.web.common.shared.dto.CurrencyRateViewLoadDTO;

@RemoteServiceRelativePath("common")
public interface WebCommonContoller extends RemoteService {
	UserData login(String loginID, String password, String dsName) ;
	int logout();
	List<String[]> getDSNames();
	AppItemListDTO getAllAppItems();
	
	//SystemProperty
	SystemProperty getSystemProperty(String key);
	//End SystemProperty
	
	//Office
	BranchListDTO getAllBranch();
	//End Office
	
	//Currency
	int createCurrency(Currency currency);
	int updateCurrency(Currency currency);
	int deleteCurrency(long currencyId);
	CurrencyDataListDTO getCurrencyList(Currency cri);
	List<CurrencyReferenceData> getAllCurrency();
	int viewCurrencyReport(String fromCode, String toCode);
	int prepareCurrencyReport(CurrencyRpt info);
	Currency findCurrencyByCode(String code);
	//End Currency
	
	//Currency Rate
	int createCurrencyRate(CurrencyRate currencyRate);
	int updateCurrencyRate(CurrencyRate currencyRate);
	int deleteCurrencyRate(long key);
	CurrencyRate findCurrencyRate(long key);
	CurrencyRateDataListDTO findCurrencyRates(CurrencyRate params);
	CurrencyRateDetail findLatestDetail(long currencyRateId);
	CurrencyRateDetail findLatestDetail(long sourceCurrencyId, long convertCurrencyId);
	CurrencyRateViewLoadDTO getCurrencyRateViewLoadDTO();
	int prepareCurrencyRateReport(CurrencyRateRpt info);
	CurrencyRate getSourcetoHomeRate(long source_currency);
	CurrencyRate findCurrencyRateByCode(String code);	
	//End Currency Rate
	
	//Office
	int createBranch(Branch office);
	int updateBranch(Branch office);
	int deleteBranch(long key);
	BranchDataListDTO findBranches(Branch cri);
	BranchViewLoadDTO getBranchViewLoadDTO();
	//End Office
	
	// Country 
	int createCountry(Country country);
	int updateCountry(Country country);
	int deleteCountry(long countryId);
	CountryDataListDTO findCountry(Country cri);
	Country findCountryByCode(Country entity);	
	int prepareCountryReport(CountryRpt info);
	//End Country
	
	// Branch Type
	int createBranchType(BranchType branchType);
	int updateBranchType(BranchType branchType);
	int deleteBranchType(long branchTypeId);
	BranchTypeDataListDTO findBranchTypes(BranchType cri);
	BranchType findBranchTypeByCode(BranchType entity);
	// MBC
	int prepareBranchTypeReport(BranchTypeRpt branchType);
	// End Branch Type
	
	//Branch
	Branch findBranchByCode(String code);
	int prepareBranchReport(BranchRpt info);
	//End Branch
	
	int heartBeat(Date latestDateTime);
}
